<%@ page import="com.opensymphony.xwork2.util.ValueStack" %>
<%@ page import="examinee.ExamineeInfo" %>
<%@ page import="exam.AnswerPaperInfo" %>
<%@ page import="java.util.List" %>
<%@ page import="utils.TextUtils" %>
<%@ page import="question.QuestionUtils" %>
<%@ page import="exam.TestPaperInfo" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
  ValueStack vs = (ValueStack)request.getAttribute("struts.valueStack");
  ExamineeInfo einfo = (ExamineeInfo) vs.findValue("einfo");
  TestPaperInfo tinfo = (TestPaperInfo) vs.findValue("tinfo");
  List<AnswerPaperInfo> alist = (List<AnswerPaperInfo>) vs.findValue("alist");
  int score = 0;
  for(AnswerPaperInfo info : alist) {
    if(info.getAnswer() != null && info.getAnswer().equals(info.getStandardAnswer())) {
      score += QuestionUtils.getValue(info.getTx(), tinfo);
    }
  }
%>
<h2 class="title info">
  <span>准考证号：</span><%=einfo.getZkzh()==null?"":einfo.getZkzh()%>
  <span>姓名：</span><%=einfo.getEname()==null?"":einfo.getEname()%>
  <span>分数：</span><%=score%>
</h2>
<iframe name="submithidden" style="display:none" id="submithidden" ></iframe>
<div class="admin-tablenav" style="float:right; margin-top:-20px;">
<form target="submithidden" method="post" action="print.action?eid=<%=einfo.getEid()%>">
  <button type="submit" class="normal"><span></span>
    <img src="../../skin/default/print.gif"/>打印列表</button>
	</form>
</div>

<!--成绩列表-->
<table cellpadding="0" width="100%" cellspacing="0" class="admin-table" style="margin:0 auto;">
  <thead>
    <tr>
      <th width="800"><span class="first"></span>试题内容</th>
      <th style="width:60px">答案</th>
      <th style="width:80px;" class="last">正确答案</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td colspan="3" style="padding:0;">
        <div style="height:350px; overflow:hidden;overflow-y:scroll;width:100%">
          <table cellpadding="0" width="98%" class="admin-table" cellspacing="0" style="margin:0;">
            <tbody id="infolist">
              <%
                for(AnswerPaperInfo info : alist){
              %>
              <tr>
                <td class="first"><%=TextUtils.html(info.getContent())%></td>
                <td width="55"><%=info.getAnswer() == null || info.getAnswer().length()==0 ? "&nbsp;" : QuestionUtils.getAnswer(info.getTx(), info.getAnswer())%></td>
                <td width="63" class="last"><%=QuestionUtils.getAnswer(info.getTx(), info.getStandardAnswer())%></td>
              </tr>
              <%
                }
              %>
            </tbody>
          </table>
        </div>
      </td>
    </tr>

  </tbody>
</table>